<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/WEB-INF/view/system/common/head.jsp"%>
<style>
.leftTd1{
   width:20%;
   text-align:right;
 }
 .rightTd{
   width:26%;
   text-align:left;
 }
</style>

<body>
	<form id="groupUpdateForm" name="groupUpdateForm" method="post" action="">
		<div id="p" class="easyui-panel" title="修改分组" style="padding: 10px; background: #fafafa;text-align:center;">
			<fieldset>
				<legend style="color: blue;font-size:1.5" > 分组信息</legend>
				<table class="infoTable">
					<tr>
						<td class="leftTd1"> 分组类型 : </td>
						<td colspan="3" class="redText">
						<c:choose>
							<c:when test="${group.type == 0}">公司</c:when>
							<c:when test="${group.type == 1}">总分组</c:when>
							<c:when test="${group.type == 2}">子分组</c:when>
						</c:choose>
						</td>
					</tr>
					<tr>
						<td class="leftTd1"> 分组名称 : </td>
						<td class="rightTd">
							<input type="text" id="updateGroup_name" name="name"
								value="${group.name}" maxlength="30" class="easyui-validatebox myinput"
								required="true" validType="length[1,30]" 
								missingMessage="请输入分组名称"  placeholder="请输入分组名称"/>
						</td>
						<td class="leftTd1">分组编码<span class="colrRed"> * </span>：</td>
						<td class="rightTd redText">
							<input type="hidden" name="id" value="${group.id}" />
							<input type="text" id="updateGroup_code" name="code"  
								value="${group.code}" maxlength="10" class="easyui-validatebox"
								missingMessage="请输入分组编码"  placeholder="请输入分组编码"
								required="true" validType="length[1,10]" />
						</td>
					</tr>
					<tr>
						<td class="leftTd1">
							分组描述 :
						</td>
						<td colspan="3">
							<textarea class="easyui-validatebox" id="updateGroup_descr"
								name="descr"  rows="3"
								MaxLength="150" cols="50" >${group.descr}</textarea>
						</td>
					</tr>
					
				<%-- 	<tr>
						<td class="leftTd1"> 添加子分组 ： </td>
						<td >
						<c:choose>
						  <c:when test="${group.childstate == 1}">
					      <label >可以添加</label>   
                          <input type="radio" id="childState1" name="childstate" value="1" checked="checked" />
                          <label >无法添加</label>   
                          <input type="radio" id="childState2" name="childstate" value="2" />
                          </c:when>
                          <c:when test="${group.childstate == 2}">
					      <label >可以添加</label>   
                          <input type="radio" id="childState1" name="childstate" value="1" />
                          <label >无法添加</label>   
                          <input type="radio" id="childState2" name="childstate" value="2" checked="checked" />
                          </c:when>
                         </c:choose>
 	               </td>
 	               </tr> --%>
				</table>
			</fieldset>
			
			<div  style="text-align:center;padding-top:10px;">
				<br />
				<a class="easyui-linkbutton myLink" iconCls="icon-ok" onclick="submitForm()">修改 </a>
				&nbsp;&nbsp;&nbsp;
				<a class="easyui-linkbutton myLink" iconCls="icon-undo" onclick="resetFrom()">重置</a>
			</div>
		</div>
	</form>
</body>
<script>
//重置
function resetFrom() {
	$("#groupUpdateForm").form("reset");
}

//页面提交
function submitForm() {
	//判断参数是否为空
	var valid = $('#groupUpdateForm').form('validate');
	if (valid) {
		var param = $('#groupUpdateForm').serializeJson(true);
		$.axs("usergroup/doGroupUpdate.action", param, 
                function(data){
			if(data.status == 1){
				$.messager.alert("提示信息",
						data.msg, 'info', function() {
				parent.$("#groupTreegrid").treegrid('reload');
				});
			}else{
				$.messager.alert("提示信息", data.msg, 'error');
			}
		});
		/* //获取页面上所有的参数
		var param = getFormElementsForUrl();
		//提交后台处理  
		$.post("doGroupUpdate.action" + param, callback); */
	}
}

</script>
</html>